package com.mcptt.http.auth.process.passwd.result;

import com.mcptt.http.auth.process.result.AuthResult;

public class FirstGetResult extends AuthResult
{
	private String cookie = "";

	public FirstGetResult(int result, String desc)
	{
		super(result, desc);
	}

	public String getErrStr()
	{
		StringBuffer strBuf = new StringBuffer("SecondGetResult  ");
		strBuf.append("result=").append(result);
		if(desc != null
				&& desc.length() >0)
		{
			strBuf.append(",");
			strBuf.append("desc=").append(desc);
		}
		else
		{
			strBuf.append(";");
		}

		return strBuf.toString();
	}

	public String toString()
	{
		StringBuffer strBuf = new StringBuffer("FirstGetResult  ");
		strBuf.append("cookie=").append(cookie).append(";");

		return strBuf.toString();
	}

	public boolean isSuc()
	{
		if (result == 200)
		{
			return true;
		}
		return false;
	}

	public boolean checkReturnParamOk()
	{
		if(cookie == null
				|| cookie.length() <= 0)
		{
			return false;
		}
		return true;
	}

	public String getCookie()
	{
		return cookie;
	}

	public void setCookie(String cookie)
	{
		this.cookie = cookie;
	}
}
